USE [ERP]
GO

/****** Object:  Table [dbo].[EmployeeEvaluations]    Script Date: 11/16/2009 14:31:24 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[EmployeeEvaluations](
	[EmployeeID] [nvarchar](50) NOT NULL,
	[EvaluationID] [nvarchar](50) NULL,
	[AverageScoreID] [nvarchar](50) NULL,
	[Detailes] [xml] NULL,
	[RelatedRaiseID] [nvarchar](50) NULL,
	[Date] [datetime] NOT NULL,
 CONSTRAINT [PK_EmployeeEvaluations] PRIMARY KEY CLUSTERED 
(
	[EmployeeID] ASC,
	[Date] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[EmployeeEvaluations]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeEvaluations_EmployeeRaises] FOREIGN KEY([RelatedRaiseID])
REFERENCES [dbo].[EmployeeRaises] ([ID])
GO

ALTER TABLE [dbo].[EmployeeEvaluations] CHECK CONSTRAINT [FK_EmployeeEvaluations_EmployeeRaises]
GO

ALTER TABLE [dbo].[EmployeeEvaluations]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeEvaluations_Employees] FOREIGN KEY([EmployeeID])
REFERENCES [dbo].[Employees] ([ID])
GO

ALTER TABLE [dbo].[EmployeeEvaluations] CHECK CONSTRAINT [FK_EmployeeEvaluations_Employees]
GO

ALTER TABLE [dbo].[EmployeeEvaluations]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeEvaluations_Evaluations] FOREIGN KEY([EvaluationID])
REFERENCES [dbo].[Evaluations] ([ID])
GO

ALTER TABLE [dbo].[EmployeeEvaluations] CHECK CONSTRAINT [FK_EmployeeEvaluations_Evaluations]
GO

ALTER TABLE [dbo].[EmployeeEvaluations]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeEvaluations_Scores] FOREIGN KEY([AverageScoreID])
REFERENCES [dbo].[Scores] ([ID])
GO

ALTER TABLE [dbo].[EmployeeEvaluations] CHECK CONSTRAINT [FK_EmployeeEvaluations_Scores]
GO

